home *** CD-ROM | disk | FTP | other *** search
- Path: ccshst05.cs.uoguelph.ca!ccshst01!thay
- From: thay@uoguelph.ca (Toby K Hay)
- Newsgroups: comp.lang.c
- Subject: Re: Help with sin() - big problem
- Date: 5 Mar 1996 18:44:27 GMT
- Organization: University of Guelph
- Message-ID: <4hi22b$r3n@ccshst05.cs.uoguelph.ca>
- References: <4hhusi$49i@sunburst.ccs.yorku.ca>
- NNTP-Posting-Host: ccshst01.cs.uoguelph.ca
- X-Newsreader: TIN [version 1.2 PL2]
-
- Naftali Sturm (yu114405@yorku.ca) wrote:
- : I am making a math and trigonometry program which, one of its functions
- : is to compute the sine of a number.
- : The way I did it was.
- : result = sin(numb);
-
- : The problem is that when numb is 1.0, the
- : program gives me .84147 , and when numb is 45.0
- : the program gives me .85090, and each number is a different result.
- : Why?
- Because sin() returns the sine of an angle measured in radians and you
- are giving it angles measured in degrees. Convert your angles from
- degrees to radians (by multiplying by pi/180) and you'll get the answers
- you expect. The conversion works because 180 degrees equals pi radians.
- Toby Hay thay@uoguelph.ca
-